using Qgm.Three.Back.Dtos;
using Qgm.Three.Back.Entities;
using Qgm.Three.Back.Repositories;

using WL.Think.Abp.Dto;
using WL.Think.Abp.Services;

namespace Qgm.Three.Back.Services 
{
    public class DeviceCategoryAppService: 
        BaseCategoryAppService<DeviceCategoryEntity, DeviceCategoryDto , DeviceCategoryCreateUpdateDto>, 
        IDeviceCategoryAppService
    { 
        protected new readonly IDeviceCategoryRepository Repository;

        public DeviceCategoryAppService(
            IDeviceCategoryRepository repository) : base(repository)
        {
            Repository = repository;
        }

        protected override async Task<IQueryable<DeviceCategoryEntity>> CreateFilteredQueryAsync(BasePagedDto input)
        {
            var queryable = await base.CreateFilteredQueryAsync(input);
            return queryable.OrderBy(x => x.Index);
        }
    }
}
